package com.xlf.service.base.controller.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xlf.common.core.annotation.Anonymous;
import com.xlf.common.core.pojo.mode.AjaxResult;
import com.xlf.common.core.pojo.mode.BaseController;
import com.xlf.pojo.base.Difficulty;
import com.xlf.service.base.service.DifficultyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xlf 2734029211@qq.com
 * @Date 2023/10/3 10:14
 * @Description: TODO 难度模块
 * @Version 1.0
 */
@RestController
@RequestMapping("/base/difficulty")
public class DifficultyController extends BaseController {

    @Autowired
    DifficultyService difficultyService;

    @Anonymous
    @GetMapping("/list")
    public AjaxResult list(){
        LambdaQueryWrapper<Difficulty> wrapper = new LambdaQueryWrapper<>();
        wrapper.select(Difficulty::getId,Difficulty::getName,Difficulty::getIcon)
                .eq(Difficulty::getStatus,0);
        return success(difficultyService.list(wrapper));
    }



}
